﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ArduinoSketch.Core
{
    public partial class ArduioSetting : Form
    {
        private HardwareTarget _hardwareTarget;
        private ArduinoTarget _arduinoTarget;

        public ArduioSetting()
        {
            InitializeComponent();

            this.treeMenu.Nodes.Clear();
            this.CreateTreeMenu();
        }

        private void CreateTreeMenu()
        {
            TreeNode _root = new TreeNode("Arduino");
            TreeNode _child;
            _child = new TreeNode("Hardware Profile");
            _hardwareTarget = new HardwareTarget();
            _child.Tag = _hardwareTarget;
            _root.Nodes.Add(_child);

            _child = new TreeNode("Arduino Target");
            _arduinoTarget = new ArduinoTarget();
            _child.Tag = _arduinoTarget;
            _root.Nodes.Add(_child);

            this.treeMenu.Nodes.Add(_root);
            this.plContent.Controls.Add(_hardwareTarget);
            this.treeMenu.ExpandAll();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {

        }

        private void treeMenu_AfterSelect(object sender, TreeViewEventArgs e)
        {
            Control _control = (Control)e.Node.Tag;

            this.plContent.Controls.Clear();
            this.plContent.Controls.Add(_control);
        }
    }
}
